<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.general.Util" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="rs1" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%
    JSONObject jsonData = new JSONObject();
    String requestid = Util.null2String( request.getParameter( "requestid" ) );
    rs.executeQuery("select id,cglx from formtable_main_684 where requestid="+requestid);
    bb.writeLog("select id,cglx from formtable_main_684 where requestid="+requestid);
    rs.next();
    String mainid = Util.null2String(rs.getString( "id" )); // 根据当前流程id拿到明细表数据对应id
    String cglx = Util.null2String(rs.getString( "cglx" ));
    String dtl = "";//明细表
    String tableDtl = "";
     switch (cglx){
         case"0":dtl="formtable_main_684_dt1";tableDtl="formtable_main_682"; break;
         case"1":dtl="formtable_main_684_dt2";tableDtl="formtable_main_685"; break;
         case"2":dtl="formtable_main_684_dt6";tableDtl="formtable_main_687"; break;
         case"3":dtl="formtable_main_684_dt7";tableDtl="formtable_main_688"; break;
         case"4":dtl="formtable_main_684_dt8";tableDtl="formtable_main_690"; break;
    }
        rs.executeQuery("select cgxqid from "+dtl+" where mainid ="+mainid);
        bb.writeLog("select cgxqid from "+dtl+" where mainid ="+mainid);
        while (rs.next()) {
            String cgxqid = Util.null2String(rs.getString("cgxqid"));
            String sql = "update "+tableDtl+" set sfsccglx = 0 where  id ="+cgxqid;
            bb.writeLog(sql);
            rs.executeUpdate(sql);
        }
    jsonData.put( "flag",true );
    out.print( jsonData.toJSONString() );
    bb.writeLog( "getIsGenerateCglx=" + jsonData.toJSONString() );
%>


